package me.zhengjie.modules.backcard.domain;

import me.zhengjie.base.CommonModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Date;
import java.sql.Timestamp;

/**
* @author lida
* @date 2022-04-28
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("personal_backcard")
public class Backcard extends CommonModel<Backcard> implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "银行卡ID")
    @TableId(type= IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "银行卡号")
    @NotBlank
    private String cardnum;

    @ApiModelProperty(value = "用户")
    private String username;

    @ApiModelProperty(value = "银行名字")
    private String bankname;

    @ApiModelProperty(value = "创建时间")
    private Date gmtCreate;

    private String balance;

    public void copyFrom(Backcard source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
